<?php
class wms_ctl_admin_receipts_consign extends desktop_controller {
	    /**
	     * 发货处理
	     *
	     */
	    function consign(){
	        $this->begin("index.php?app=wms&ctl=admin_receipts_print&act=customerseftindex&status=1");
	        $delivery_ids = $_POST['delivery_id'];
	        $dlyProcessLib = kernel::single('wms_delivery_process');

	        foreach ($delivery_ids as $value) 
	        {
	        	$oWms_delivery = app::get('wms')->model('delivery');
	        	$delivery_bn = $oWms_delivery->dump(array('delivery_id'=>$value),'delivery_bn,deliverytype');
	        	if (in_array($delivery_bn['deliverytype'],array('pickup')) && $dlyProcessLib->consignDelivery($value)){
	        	     $this->end(true, '发货处理完成');
	        	}else {
	        	     $msg['delivery_bn'] = $delivery_bn['delivery_bn'];
	        	     $this->end(false, '发货未完成', '', array('msg'=>$msg));
	        	}
	        }

	    }
}
